package Text3;

import sun.util.resources.LocaleData;

import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

/*
 *@Student 张策
 */
public class Cal {
    public static void main(String[] args) {
        DateTimeFormatter dateTimeFormatter=DateTimeFormatter.ofPattern("yyyy年MM月dd日HH时mm分钟ss秒");
        LocalDateTime localDateTime=LocalDateTime.now();
//        LocalDateTime localDateTime1=localDateTime.plusDays(890);
//        LocalDateTime localDateTime2=localDateTime.minusMinutes(39333);
        LocalDateTime localDateTime3=localDateTime.minusMonths(1100);
//        System.out.println(dateTimeFormatter.format(localDateTime));
//        System.out.println(dateTimeFormatter.format(localDateTime1));
//        System.out.println(dateTimeFormatter.format(localDateTime2));
        System.out.println(dateTimeFormatter.format(localDateTime3));
//        Instant i=Instant.now();
//        System.out.println(i);
//        Date d=Date.from(i);
//        System.out.println(d);
//        Instant instant = d.toInstant();
//        System.out.println(instant);
//        LocalDateTime dt= LocalDateTime.now();
//        DateTimeFormatter dtf=DateTimeFormatter.ofPattern("yyyy年MM月dd日HH时mm分钟ss秒");
//        String dtf2=dtf.format(dt);
//        System.out.println(dt);
//        System.out.println(dtf);
//        System.out.println(dtf2);
//        System.out.println("年:"+dt.getYear());
//        System.out.println("月:"+dt.getMonth());
//        System.out.println("月:"+dt.getMonthValue());
//        System.out.println("日:"+dt.getDayOfMonth());
//        System.out.println("时:"+dt.getHour());
//        System.out.println("分:"+dt.getMinute());
//        System.out.println("秒:"+dt.getSecond());
//        LocalDate d=LocalDate.now();
//        System.out.println(d);//2024-01-06
//        System.out.println(d.getYear());//2024
//        LocalTime t=LocalTime.now();
//        System.out.println(t);//16:26:13.062
//        Calendar c=Calendar.getInstance();
//        System.out.println(c);
//        System.out.println("年:"+c.get(Calendar.YEAR));
//        System.out.println("月:"+c.get(Calendar.MONTH)+1);
//        System.out.println("日:"+c.get(Calendar.DAY_OF_MONTH));
//        System.out.println("时:"+c.get(Calendar.HOUR_OF_DAY));
//        System.out.println("分:"+c.get(Calendar.MINUTE));
//        System.out.println("秒:"+c.get(Calendar.SECOND));
    }
}
